﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WinnerCMS.Data.Mapping
{
    public partial class UserMap
        : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<WinnerCMS.Model.User>
    {
        public UserMap()
        {
            // table
            //ToTable("CMS_Users");

            // keys
            HasKey(t => t.Id);

            // Properties
            Property(t => t.Id)
                
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            Property(t => t.UserName)
                
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.PassWord)
                
                .HasMaxLength(32).IsUnicode(false)
                .IsRequired();
            Property(t => t.LastLoginIP)
                
                .HasMaxLength(16)
                .IsOptional();
            Property(t => t.LastLoginTime)
                
                .IsOptional();
            Property(t => t.LoginTimes)
                
                .IsRequired();
            Property(t => t.IsAdmin)
                
                .IsRequired();
            Property(t => t.HomePage)
                
                .HasMaxLength(255)
                .IsOptional();
            Property(t => t.QQ)
                .IsUnicode(false)
                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.PetName)
                
                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.Introduce)
                
                .HasMaxLength(255)
                .IsOptional();
            Property(t => t.EMail)
                
                .HasMaxLength(150)
                .IsOptional();
            Property(t => t.Coin)
                
                .IsRequired();
            Property(t => t.Point)
                
                .IsRequired();
            Property(t => t.Experience)
                
                .IsRequired();
            Property(t => t.Mature)
                
                .IsOptional();
            Property(t => t.Question)
                
                .HasMaxLength(255)
                .IsOptional();
            Property(t => t.Answer)
                
                .HasMaxLength(255)
                .IsOptional();
            Property(t => t.Sex)
                
                .IsRequired();
            Property(t => t.ActiveType)
                
                .IsRequired();
            Property(t => t.RegTime)
                
                .IsOptional();
            Property(t => t.IsLocked)
                
                .IsRequired();
            Property(t => t.TrueName)
                
                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.Msn)
                
                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.Birthday)
                
                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.Province)
                
                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.City)
                
                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.Icq)
                .IsUnicode(false)
                .HasMaxLength(12)
                .IsOptional();
            Property(t => t.Yahoo)
                .IsUnicode(false)
                .HasMaxLength(40)
                .IsOptional();
            Property(t => t.Skype)
                .IsUnicode(false)
                .HasMaxLength(40)
                .IsOptional();
            Property(t => t.Location)
                
                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.IdCard)
                .IsUnicode(false)
                .HasMaxLength(20)
                .IsOptional();
            Property(t => t.Mobile)
                .IsUnicode(false)
                .HasMaxLength(20)
                .IsOptional();
            Property(t => t.Phone)
                .IsUnicode(false)
                .HasMaxLength(20)
                .IsOptional();
            Property(t => t.Address)
                
                .HasMaxLength(255)
                .IsOptional();

            // Relationships

           

            //InitializeMapping();
        }
    }
}

